﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing;
using UserDefineForm.formcomponent;
using UserDefineForm.control.propertymapping;

namespace UserDefineForm.control
{
    public class DesignableTextBox:DesignableControlBase
    {

        override public String Value
        {
            set
            {
                TextBox txtBox = (TextBox)this.control;
                txtBox.Text = value;
            }

            get
            {
                TextBox txtBox = (TextBox)this.control;
                return txtBox.Text;
            }
        }

        protected TextBox txtBox;

        public DesignableTextBox()
        {
        }

        public DesignableTextBox(DesignPanel designPanel, PropertiesPanelv2 propPnl)
            : base(designPanel, propPnl)
        {
            this.txtBox = new TextBox();
            this.control = txtBox;
            this.mainPnl.Controls.Add(this.control);
            this.mappingObject = new TextBoxMappingObject();

            control.Dock = DockStyle.Fill;
            txtBox.Multiline = true;
        }

        public override ControlType getType()
        {
            return ControlType.TextBox;
        }
    }
}
